package com.yaoge.around.aspect;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

//用@Aspect来表明这是一个切面类，让AspectJ能够找到这个切面类
@Aspect
public class SellAspect {
   @Around(value = "execution(* com.yaoge.around.service.*.Sell(..) )")
    public  void sellAdvance(ProceedingJoinPoint pjp){
       System.out.println("我可以决定-----"+pjp.getSignature()+"的执行还是不执行");
       try {
           pjp.proceed();
       } catch (Throwable throwable) {
           throwable.printStackTrace();
       }
       System.out.println("他执行了之后，我还是可以执行，哈哈哈哈哈哈");
   }


}
